using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Evaluation3.utils;
using Evaluation3.classes;

public partial class adminRender : System.Web.UI.Page, Evaluation3.interfaces.pageIMP
{
    httpUtils objUtils = new httpUtils();
    remoteUser objRU = new remoteUser();
    protected void Page_Load(object sender, EventArgs e)
    {
        try
        {

            //checkPermistion(getRemoteUser());
            Session["CompanyID"] = ((remoteUser)Session["remoteUser"]).companyID;
            
            string sURL = Request.Url.ToString().ToLower();
            if (sURL.EndsWith(".aspx"))
            {
                return;
            }
            main.Controls.Add(objUtils.LoadModule("mod"));

            //Response.Write(((remoteUser)Session["remoteUser"]).companyID);
        }
        catch (Exception ex)
        {
            Response.Redirect("../../Login.aspx");
        }
    }

    public void checkPermistion(remoteUser remoteUser)
    {
        if ((remoteUser == null) || (!remoteUser.uRight.Equals("1")))
        {
            Response.Redirect("../../login.aspx");
        }

    }

    public Evaluation3.classes.remoteUser getRemoteUser()
    {
        return (Evaluation3.classes.remoteUser)Session["remoteUser"];
    }

    public void btn_logOut_Click(Object sender, EventArgs e)
    {
        Response.Redirect("../../logout.aspx");
    }
}
